<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>资质证书管理</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<script language="javascript" type="text/javascript"
			src="<%=basePath%>datemaker/WdatePicker.js">
		</script>
		<script type="text/javascript" src="manage/js/jquery.js"></script>
		<script type="text/javascript" src="manage/js/addbg.js"></script>
		<link rel="stylesheet" type="text/css" href="<%=basePath%>manage/css/addTravel.css"></link>
	</head>
	<center> 
		<body>
			<s:form action="alterCoCertificate" method="post"
				enctype="multipart/form-data">
		<table>
			<thead>
				<tr>
					<td colspan="2" align="center">修改资质证书</td>
				</tr>
			</thead>
			
			<tbody>
					<tr>
						<td>
							证&nbsp;书&nbsp;名&nbsp;称
						</td>
						<td>
							<s:textfield name="coCertificate.name"
								value="%{coCertificate.name}"></s:textfield>
						</td>
					</tr>
					<tr>
						<td>
							发&nbsp;证&nbsp;日&nbsp;期
						</td>
						<td>
							<input type="text" name="coCertificate.issueDate" id="issueDate"
								value="<s:date name="coCertificate.issueDate" format="yyyy-MM-dd"/>"
								class="Wdate" onClick="WdatePicker()" />
						</td>
					</tr>
					<tr>
						<td>
							发&nbsp;证&nbsp;单&nbsp;位
						</td>
						<td>
							<s:textfield name="coCertificate.issueUnit" id="issueUnit"
								value="%{coCertificate.issueUnit}"></s:textfield>
						</td>
					</tr>
					<tr>
						<td>
							证书有效期
						</td>
						<td>
							<input type="text" name="coCertificate.validityPeriod"
								value="<s:date name="coCertificate.validityPeriod" format="yyyy-MM-dd"/>"
								class="Wdate" onClick="WdatePicker()" />
						</td>
					</tr>
					<tr>
						<td>
							证&nbsp;书&nbsp;类&nbsp;别
						</td>
						<td>
							<select name="coCertificate.type.id" id="coCertificateId" />
								<option value="5" <s:if test="coCertificate.type.name == '营业执照'">selected="selected"</s:if>>
									营业执照
								</option>
								<option value="6" <s:if test="coCertificate.type.name == '组织机构代码证'">selected="selected"</s:if>>
									组织机构代码证
								</option>
								<option value="4" <s:if test="coCertificate.type.name == '其他'">selected="selected"</s:if>>
									其它
								</option>
							</select>
						</td>
					</tr>
					<tr>
						<td>
							上传资质证书
						</td>
						<td style="font-size:10px">
							<s:file name="picture" />
							<%
								String filePath = request.getAttribute(
											"coCertificate.url").toString();
									String contextPath = request.getRealPath("/");
									String url = filePath.replaceFirst(
											contextPath.replaceAll("\\\\", "\\\\\\\\"), "")
											.replaceAll("\\\\", "/");
							%>
							已上传资质证书：<%=url%>
							<s:hidden name="coCertificate.url"
								value="%{coCertificate.url}"></s:hidden>
						</td>
					</tr>
			</tbody>
			<tfoot>
					<tr>
						<td colspan="2" align="center">
						<input class="submit" type="submit" value="提交"  />
    					<input class="reset" type="reset" value="重置" />
							<input class="return" type="button" value="返回" onclick="window.history.back();" />
						</td>
					</tr>
			</tfoot>
				</table>
				<s:hidden name="coCertificateId" value="%{coCertificateId}"></s:hidden>
			</s:form>
		</body>
	</center>
</html>
